<?php
require ("ServletAndClassInteractionClass.php");
/* Servlet part:
 * This is a multi file example, it shows how the servlet and the class could interact with each other
 * check ServletAndClassInteractionClass to check the class part
 * I also wanted to do a small random function demonstration
 */
$fruitClass = new ServletAndClassInteractionClass();
$action = $_GET['action'];

if (strtolower($action) == 'apple') {
    echo $fruitClass->getApple();
} else if (strtolower($action) == 'lemon') {
    echo $fruitClass->getLemon();
} else {
    if ($action == '') {
        echo "No action is specified in the url, use ServletAndClassInteractionServlet.php?action=";
    } else {
        echo $action . " isn't a tasty fruit, either use apple or lemon";
    }
}
?>
